<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
    <title>Choway Blog</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description" content="七尘的个人博客">
    <meta name="keywords" content="java、python、SpringBoot、Hibernate">
    <link rel="shortcut icon" href="/images/favicon.ico">
    <link rel="stylesheet" href="/css/animate.min.css">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/kratos.diy.css">
    <link rel="stylesheet" href="/css/layer.min.css">
    <link rel="stylesheet" href="/css/superfish.min.css">
    <link rel="stylesheet" href="/css/style.css">
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/hoverIntent.min.js"></script>
    <script src="/js/jquery.easing.min.js"></script>
    <script src="/js/jquery.qrcode.min.js"></script>
    <script src="/js/jquery.stellar.min.js"></script>
    <script src="/js/jquery.waypoints.min.js"></script>
    <script src="/js/kratos.diy.js"></script>
    <script src="/js/kratos.js"></script>
    <script src="/js/layer.min.js"></script>
    <script src="/js/modernizr.min.js"></script>
    <script src="/js/superfish.js"></script>
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/atom-one-dark.min.css">
    <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
    <script type="text/javascript">
      hljs.initHighlightingOnLoad();
    </script>
</head>


<body data-spy="scroll" data-target=".scrollspy">
    <div id="kratos-wrapper">
        <div id="kratos-page">
            <div id="kratos-header">
    <header id="kratos-header-section">
        <div class="container">
            <div class="nav-header">
                <a href="#" class="js-kratos-nav-toggle kratos-nav-toggle"><i></i></a>
                <h1 id="kratos-logo"><a href="/">Choway Blog</a></h1>
                
                <nav id="kratos-menu-wrap">
                  <ul id="kratos-primary-menu" class="sf-menu">
                  
                    <li>
                      <a href="/categories/Java/">Java</a>
                    </li>
                  
                    <li>
                      <a href="/categories/DevOps/">DevOps</a>
                    </li>
                  
                  </ul>
                </nav>
            </div>
        </div>
    </header>
</div>

<div class="kratos-start kratos-hero-2 kratos-post-header">
    <div class="kratos-overlay kratos-post" style="background:#222831"></div>
</div>
            
            <div id="kratos-blog-post" style="background:#f5f5f5;">
                <div class="container">
                    <div class="row">
                        <section id="main" class="col-md-8">
                            <!--  文章模板  -->
<article>
    <div class="kratos-hentry kratos-post-inner clearfix">
        <header class="kratos-entry-header">
            <h1 class="kratos-entry-title text-center">centos7 安装 docker</h1>
            <div class="kratos-post-meta text-center">
                <span>
                    <i class="fa fa-commenting-o"></i> choway
                    <i class="fa fa-calendar"></i> 2018-12-14 05:09:03
                    <i class="fa fa-eye"></i> 
                    
                        <a class="category-link" href="/categories/DevOps/">DevOps</a><a class="category-link" href="/categories/DevOps/Docker/">Docker</a>
                    
                </span>
            </div>
        </header>
        <div class="kratos-post-content">
            <p>Docker 是开发人员和系统管理员使用容器开发，部署和运行应用程序的平台，用于轻松部署应用程序。Docker 可以将应用程序与基础架构分离，以便快速交付软件；可以像管理应用程序一样管理基础架构。通过利用 Docker 的方法快速发送，测试和部署代码，显著减少编写代码和在生产中运行代码之间的延迟。</p>
<a id="more"></a>
<h2 id="系统要求"><a href="#系统要求" class="headerlink" title="系统要求"></a>系统要求</h2><ul>
<li>centos 7</li>
<li>centos-extras库必须启用</li>
</ul>
<h2 id="卸载旧版本"><a href="#卸载旧版本" class="headerlink" title="卸载旧版本"></a>卸载旧版本</h2><p>较旧版本的Docker被称为docker或docker-engine。如果已安装这些，请卸载它们以及相关的依赖项。</p>
<pre><code class="bash">$ sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
</code></pre>
<h2 id="使用存储库安装"><a href="#使用存储库安装" class="headerlink" title="使用存储库安装"></a>使用存储库安装</h2><ol>
<li>安装所需的包</li>
</ol>
<pre><code class="bash">$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
</code></pre>
<ol start="2">
<li>使用以下命令设置稳定存储库</li>
</ol>
<pre><code class="bash">$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
</code></pre>
<ol start="3">
<li>安装 docker ce</li>
</ol>
<pre><code class="bash">$ sudo yum install docker-ce
</code></pre>
<p>Docker已安装但尚未启动。该docker组已创建，但没有用户添加到该组。</p>
<ol start="4">
<li>启动Docker</li>
</ol>
<pre><code class="bash">$ sudo systemctl start docker
</code></pre>
<ol start="5">
<li>运行hello-world 映像验证是否已正确安装</li>
</ol>
<pre><code class="bash">$ sudo docker run hello-world
</code></pre>

        </div>
        <footer class="kratos-entry-footer clearfix">
            <div class="post-like-donate text-center clearfix" id="post-like-donate">

            </div>
            <div class="footer-tag clearfix">
                <div class="pull-left">
                    <i class="fa fa-tags"></i>
                    
                        <a class="tag-link" href="/tags/centos/">centos</a><a class="tag-link" href="/tags/docker/">docker</a>
                    
                </div>
            </div>
        </footer>
    </div>
    <div class="kratos-hentry kratos-copyright text-center clearfix">
        <img alt="知识共享许可协议" src="/images/licenses.png">
        <h5>本作品采用 <a rel="license nofollow" target="_blank" href="http://creativecommons.org/licenses/by-sa/4.0/">知识共享署名-相同方式共享 4.0 国际许可协议</a> 进行许可</h5>
    </div>

    
    <nav class="navigation post-navigation clearfix" role="navigation">
        
        <div class="nav-previous clearfix">
            <a title="Dockerfile 编写" href="/dockerfile-command.html">&lt; 上一篇</a>
        </div>
        
        
        <div class="nav-next">
            <a title="JVM 内存区域" href="/JVM-memory.html">下一篇 &gt;</a>
        </div>
        
    </nav>
    
</article>
                        </section>

                        <aside id="kratos-widget-area" class="col-md-4 hidden-xs hidden-sm scrollspy">
                            <div id="sidebar">
    <aside id="kratos_about-2" class="widget amadeus_about clearfix">
        <div class="photo-background">
            <div class="photo-background" style="background:url(/images/about_bg.jpg) no-repeat center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;"></div>
        </div>
        <div class="photo-wrapper clearfix">
            <div class="photo-wrapper-tip text-center">
                <a href="/"><img class="about-photo" src="/images/about_me.jpg" /></a>
            </div>
        </div>
        <div class="textwidget">
            <p style="text-align: center;font-weight:400;">Choway Blog<br />七尘的个人博客</p>
        </div>
    </aside>

    
    <aside class="widget clearfix">
        <h4 class="widget-title">文章目录</h4>
        <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#系统要求"><span class="toc-text">系统要求</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#卸载旧版本"><span class="toc-text">卸载旧版本</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#使用存储库安装"><span class="toc-text">使用存储库安装</span></a></li></ol>
    </aside>
    

    
    <aside class="widget clearfix">
        <h4 class="widget-title">文章分类</h4>
        <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/DevOps/">DevOps</a><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/DevOps/ActiveMQ/">ActiveMQ</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/DevOps/Docker/">Docker</a></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/">Java</a><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/Java/JVM/">JVM</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/SpringBoot/">SpringBoot</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/SpringCloud/">SpringCloud</a></li></ul></li></ul>
    </aside>
    

    
    <aside class="widget clearfix">
        <h4 class="widget-title">标签聚合</h4>
        <div class="tag_clouds">
            <a class="tag-link" href="/tags/activemq/">activemq</a><a class="tag-link" href="/tags/centos/">centos</a><a class="tag-link" href="/tags/docker/">docker</a><a class="tag-link" href="/tags/hotspot/">hotspot</a><a class="tag-link" href="/tags/java/">java</a><a class="tag-link" href="/tags/jms/">jms</a><a class="tag-link" href="/tags/jvm/">jvm</a><a class="tag-link" href="/tags/redis/">redis</a><a class="tag-link" href="/tags/spring-cloud/">spring cloud</a><a class="tag-link" href="/tags/springboot/">springboot</a>
        </div>
    </aside>
    

</div>
                        </aside>
                    </div>
                </div>
            </div>

            <footer>
    <div id="footer">
        <div class="cd-tool visible-lg text-center">
            <a class="cd-top cd-is-visible cd-fade-out"><span class="fa fa-chevron-up"></span></a>
        </div>
        <div class="container">
            <div class="row">
                <div class="col-md-6 col-md-offset-3 footer-list text-center">
                    <p class="kratos-social-icons">
                        <a target="_blank" rel="nofollow" href="https://github.com/choway"><i class="fa fa-github"></i></a>
                    </p>
                    <p>Copyright 2020 <a href="/">Choway Blog</a>. All Rights Reserved.
                </div>
            </div>
        </div>
    </div>
</footer>
        </div>
    </div>
</body>
</html>